home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / fmodla13.zip / BREAK.DEF < prev    next >
Text File  |  1992-01-29  |  2KB  |  50 lines

  1. DEFINITION MODULE Break;
  2.  
  3. (* (C) Copyright 1987 Fitted Software Tools. All rights reserved. *)
  4.  
  5. (*
  6.     This module allows the user to trap the Ctrl-Break (vector 1BH)
  7.     interrupt and the DOS generated (vector 23H) Ctrl-C interrupt.
  8.  
  9.     Upon initialization, BREAK is disabled. Ths user program must
  10.     call EnableBreak to allow processing of breaks.
  11.  
  12.     The break interrupt handlers check the DOS busy flag to prevent
  13.     Ctrl-Break processing while in DOS.
  14.  
  15.     The default break handler simply terminates the program (ErrorLevel 6).
  16.  
  17.     DisableBreak is called before control is transfered to a user
  18.     break handler. Should the user break handler procedure return,
  19.     the program is terminated (ErrorLevel 6).
  20.  
  21.     Uses: To prevent the user from terminating the program via Ctrl-Break
  22.           or Ctrl-C, just import this module.
  23.  
  24.           During program testing, it is useful to include this module and
  25.           invoke EnableBreak; This allows the program to be aborted via
  26.           Ctrl-Break, even if the program goes into a loop.
  27. *)
  28.  
  29. PROCEDURE EnableBreak;
  30. (*
  31.     enable processing of BREAK.
  32.     the default break handler will terminate the program
  33. *)
  34.  
  35. PROCEDURE DisableBreak;
  36. (*
  37.     disable processing of BREAK
  38. *)
  39.  
  40. PROCEDURE InstallBreakHandler( breakHandler :PROC );
  41. (*
  42.     install procedure to gain control if a BREAK is detected.
  43. *)
  44.  
  45. PROCEDURE UninstallBreakHandler;
  46. (*
  47.     uninstall the user BREAK handler procedure
  48. *)
  49.  
  50. END Break.